Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: fix missing cs_main lock in AppInitMain and LoadExternalBlockFile #2728

Merged
merged 3 commits into from
Jan 23, 2022

Conversation

random-zebra
Copy link

#2715 introduced a locking assertion in InsertBlockIndex, which is currently failing (with debug enabled) because cs_main is not held during the blockindex load in AppInitMain (bitcoin@c651df8).
Also, LookupBlockIndex is being called without cs_main in LoadExternalBlockFile (bitcoin@f814a3e).
Finally there's a couple of missing locks in rest.cpp (which can be removed later, porting bitcoin#12151).

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 5ca8e22

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 5ca8e22

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code ACK 5ca8e22

Left few comments

src/rpc/rawtransaction.cpp Show resolved Hide resolved
src/validation.cpp Show resolved Hide resolved
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k, ACK 5ca8e22 and merging..

@furszy furszy merged commit be27fba into PIVX-Project:master Jan 23, 2022
furszy added a commit that referenced this pull request Feb 3, 2022
…JSON and TxToJSON

5e0d308 rpc: Remove cs_main lock from TxToJSON (random-zebra)
fe7b1cf rpc: Remove cs_main lock from blockToJSON and blockHeaderToJSON (João Barbosa)

Pull request description:

  Follow-up to #2728.
  This pull makes blockToJSON, blockheaderToJSON, and TxToJSON free of cs_main locks by passing the chainTip and using `GetAncestor` to check if a block is part of the active chain (as per bitcoin#12151).

ACKs for top commit:
  Fuzzbawls:
    ACK 5e0d308
  furszy:
    utACK 5e0d308 and merging..

Tree-SHA512: 800b45962489a66d45044618c1a40f39cd498efd7eb573db5cf0d6a07edf9fa68ca0e69a3a599f133802daddb1d2efd4ecb80d0bbf1fd17f8b4cef67ee7dd410
@Fuzzbawls Fuzzbawls modified the milestones: 6.0.0, 5.5.0 Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants